<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<%@include file="/commons/commonList.jsp" %>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/fileupload/imageUpload.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript">

	function Environment() {
		this.environmentId = null;

		this.opentAdd = function(){
			var url = "${ctx}/house_projectAction.do?method=initProjectEnvironmentAdd";
			top.windowOpen(url ,"projectEnvironmentAdd","${key.environment_add}",400,450,true,"projectEnvironmentAddFrame");
		}
		this.openEdit = function(){
			if(validateIdNull()){
				ErrorAlert("${key.tipsByModify}");
				return;
			}
			var url ="${ctx}/house_projectAction.do?method=initProjectEnvironmentEdit&environmentId=" + this.environmentId;
			top.windowOpen(url,"projectEnvironmentEdit","${key.environment_edit}",400,450,true,"projectEnvironmentEditFrame");
		}
		this.openDelete = function(){
			AskConfirm("${key.tipsByDeleteConfirm}","${empty isArea ? 'projectInfo' : 'areaInfoIframe'}","optionDelete");
		}
	}

	function submitForm(){
		parent.windowOption.setButtonUsed();
	}
	function allowClose(){
		return true;
	}
	/***点击删除图片后的回调删除方法****/
	function  optionDelete(){
		if(validateIdNull()){
			ErrorAlert("${key.tipsBySelect}");
			return;
		}
		var url ="${ctx}/house_projectAction.do?method=deleteEnvironmentById";
		var str = "environmentId=" +environment.environmentId;
		new Ajax.Request(url,
	                    {method: 'post', parameters: str, onComplete: function(){
	                    						parent.tabOption.flushTab();
	                    					}
	                    }
	                    );
	}
	/****验证ID不能为空****/
	function validateIdNull(){
		return environment.environmentId == null || environment.environmentId  == "";
	}
	var environment = null;
	function init(){
		environment = new Environment();
	}
</script>
</head>
<body onload="init();">
<table width="100%" height="387px" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr>
   <td valign="top">
   	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tab_line">
       <tr>
          <td valign="top">
          	<table width="100%" border="0" cellspacing="0" cellpadding="0" >
              <tr>
                <td class="bg_toolBar">
                	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	                    <tr>
	                       <td width="35%" align="right">
	                       	<table border="0" cellpadding="0" cellspacing="0" id="ico1">
	                           <tr>
	                             <td class="toolbarico"><a href="#"  onclick="environment.opentAdd();" onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新增配套设施"/>&nbsp;</a></td>
	                             <td class="toolbarico" ><a href="#" onClick="environment.openEdit();" onFocus="this.blur()" ><img src="${ctx}/images/ico_amend.gif" alt="修改配套设施" width="16" height="16" border="0" align="absbottom" /></a></td>
	                             <td class="toolbarico"><a href="#"  onclick="environment.openDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom"></a></td>
	                           </tr>
	                        </table>
	                       </td>
	                   </tr>
                   </table>
                </td>
                </tr>
                <tr>
                     <td>
	<ec:ceTable items="projectVO.environmentVO"
				autoIncludeParameters="true"
				scope="session"
				var="environmentItem"
				action=""
				rowsDisplayed="5"
				width="100%"
				view="pmsview"
				styleClass="gridData"
			>
			<ec:ceRow styleClass="grid" onclick="environment.environmentId = '${environmentItem.keyword}'" onContextMenu="return ShowContextMenu(event,'quick_rightmenu')">
				<ec:ceColumn property="name" headerCell="pmsHeadrCell" width="25%" title="${key.environment_name}"></ec:ceColumn>
				<ec:ceColumn property="description" headerCell="pmsHeadrCell"  width="25%"  title="${key.environment_description}"></ec:ceColumn>
				<ec:ceColumn property="ichnographysImage.name" headerCell="pmsHeadrCell"   width="25%" title="${key.environment_ichnographysImage}" showTitle="false">
					<c:if test="${not empty environmentItem.ichnographysImage}">
						<a href="javascript:preview('${environmentItem.ichnographysImage.id}')" >${environmentItem.ichnographysImage.name}</a>
					</c:if>
				</ec:ceColumn>
				<ec:ceColumn property="visionImage.name" headerCell="pmsHeadrCell" width="25%" title="${key.environment_visionImage}" showTitle="false">
					<c:if test="${not empty environmentItem.visionImage}">
						<a href="javascript:preview('${environmentItem.visionImage.id}')" >${environmentItem.visionImage.name}</a>
					</c:if>
				</ec:ceColumn>
			</ec:ceRow>
	</ec:ceTable>

<!--------------------右键显示 新增更多菜单 开始---------------------->
<div id="quick_rightmenu" class="quick_menu2" style="display:none;">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg" onMouseOver="showmy2menu('quick_rightmenu')" onMouseOut="hidden2menu('quick_rightmenu')">
       <tr>
      <td>
	  <table width="100%" border="0" cellpadding="2" cellspacing="0">
	    <tr>
         <td class="quickMenu_toolbarico"><a href="#" onClick="environment.opentAdd();" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" alt="新增" border="0" align="absbottom"/>&nbsp;新 增</a></td>
          </tr>
        <tr>
         <td class="quickMenu_toolbarico"><a href="#" onClick="environment.openEdit();" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="更改" border="0" align="absbottom"/>&nbsp;更 改</a></td>
          </tr>
		   <tr>
         <td class="quickMenu_toolbarico"><a href="#" onClick="environment.openDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删除" width="16" height="16" border="0" align="absbottom">&nbsp;删 除</a></td>
          </tr>

      </table></td>
    </tr>
  </table>
</div>
</body>
</html>